<?php
require '../../packages/connect_database.php';
mysql_select_db('auction');
$query_table = mysql_query("SHOW TABLES FROM auction");
$table = mysql_fetch_row($query_table);
$i = 0;
$isNull = false;
while($i < mysql_num_rows($query_table)) {
	if($table[0] != "auction" && $table[0] != "setup") {
		$query = mysql_query("SELECT * FROM " . $table[0] . " WHERE creator = 1");
		if(mysql_num_rows($query) == 0) {
			$isNull = true;
			break;
		}
	}
	$table = mysql_fetch_row($query_table);
	$i++;
}
$query = mysql_query("SELECT * FROM auction");
$result = mysql_fetch_row($query);
$record = "INSERT INTO {$table[0]} VALUES('{$result[0]}','{$result[1]}',";
for($i = 3;$i <= 9;$i++)
	$record .= "'{$result[$i]}',";
$record .= "{$result[10]},{$result[11]})";
mysql_query($record);
echo $table[0].substring(4,5);
